import BaseLib from "../../base/BaseLib";

export default {
  name: 'SchemaConst',

  demoCfg: {
    dragArray: {
      x: 0,
      y: 0,
      w: 2,
      h: 9,
      i: 'id_1',
    },
    frontcomchart: {
      $_chart_type: 'BarXChart',
      $_chart_cfg: {},
      fixHeight: 360,
    },
    frontcomdirective: {
      $_directive_type: '',
      $_directive_cfg: {},
      initialDate: 'none',
      initialMetric: ['newuser'],
      initialDim: ['partnerid'],
    },
    frontcompanel: {
      $_panel_type: 'PanelItem',
      $_panel_cfg: {},
      name: 'trend.distribute',
      title: '用户分布',
      usePanelLoading: true,
    },
    frontcomquery: {
      $_query_type: 'QueryImplDim',
      $_query_cfg: {},
      useCondition: true,
      metricOrder: 'metricDesc',
    },
    frontpage: {
      $_page_type: 'PageItemFix',
      $_page_cfg: {},
      name: 'trend',
      title: '用户趋势',
      pageFilter: {
        showDate: true,
      },
      panelArray: [],
    },
  },

  getDemoCfg(key) {
    const tmpCfg = this.demoCfg[key] || {};
    return BaseLib.cloneDeep(tmpCfg);
  },
};